package com.bt.aolamobile.gameconfig.configs.yearcardspringgift;

import com.bt.aolamobile.gameconfig.configs.customType.*;
import com.bt.aolamobile.gameconfig.util.CommonConfigUtil;
import com.alibaba.fastjson.TypeReference;
import com.alibaba.fastjson.parser.ParserConfig;
import com.alibaba.fastjson.JSON;
import java.time.LocalDateTime;
import java.util.Collections;
import java.util.ArrayList;
import java.util.List;
import java.util.HashMap;
import java.util.Map;

/**
 * AUTO GENERATED. DO NOT MODIFY !!!
 * FROM FILE year_card_spring_gift_config.xlsx
 * FROM SHEET export_每日奖品配置
 */
public class YearCardSpringGiftDailyBonusConfig {
    private List<YearCardSpringGiftDailyBonusConfigData> dataList = new ArrayList<>();

    private Map<Integer, Map<Integer, YearCardSpringGiftDailyBonusConfigData>> dataMap = new HashMap<>();

    public YearCardSpringGiftDailyBonusConfig() {
    }
	
	public String[] getDataFileNames() {
		return new String[]{"yearcardspringgift/YearCardSpringGiftDailyBonusConfig.json"};
	}

    public void loadJson(String jsonString) {
        List<YearCardSpringGiftDailyBonusConfigData> dataList0 = JSON.parseObject(jsonString, new TypeReference<List<YearCardSpringGiftDailyBonusConfigData>>(){}.getType(), new ParserConfig(true));
        Map<Integer, Map<Integer, YearCardSpringGiftDailyBonusConfigData>> dataMap0 = new HashMap<>();
        for (YearCardSpringGiftDailyBonusConfigData data: dataList0) {
            Map<Integer, YearCardSpringGiftDailyBonusConfigData> dataMap1 = dataMap0.get(data.getActId());
            if (dataMap1 == null) dataMap1 = new HashMap<>();
            dataMap0.put(data.getActId(), dataMap1);
            dataMap1.put(data.getStageId(), data);
        }
        dataList.addAll(dataList0);
        dataMap.putAll(dataMap0);
        dataList.forEach(CommonConfigUtil::unmodifiableList4ObjectFields);
        dataList = Collections.unmodifiableList(dataList);
        dataMap = Collections.unmodifiableMap(dataMap);
    }

    public List<YearCardSpringGiftDailyBonusConfigData> getDataList() {
        return dataList;
    }

    public Map<Integer, Map<Integer, YearCardSpringGiftDailyBonusConfigData>> getDataMap() {
        return dataMap;
    }

    public YearCardSpringGiftDailyBonusConfigData get(Integer id0,Integer id1) {
        if (dataMap.get(id0) == null) {
           return null;
        }
        if (dataMap.get(id0).get(id1) == null) {
           return null;
        }
        return dataMap.get(id0).get(id1);
    }

	public YearCardSpringGiftDailyBonusConfigData getFirstData() {
		return dataList.get(0);
	}

    public String[] getPrimaryKeyNames(){
        return new String[]{"actId","stageId"};
    }

    public String getConfigPathInfo() {
        return "File:year_card_spring_gift_config.xlsx, Sheet:export_每日奖品配置";
    }

}

